package com.cxw.healthserver.controller

import com.cxw.healthserver.constant.Constants
import com.cxw.healthserver.entity.User
import com.cxw.healthserver.resolver.CurrentUser
import com.cxw.healthserver.response.BaseResponse
import com.cxw.healthserver.service.ExamService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

/**
 * @createTime 2024/6/25 22:37
 * @author 崔兴旺
 * @description
 */
@RestController
@RequestMapping("api")
class ExamController {

    @Autowired
    private lateinit var examService: ExamService

    /**
     * 上传体检
     */
    @PostMapping("uploadExam", produces = [Constants.produces])
    fun uploadExam(@CurrentUser user: User, @RequestBody jsonStr: String): BaseResponse<Any> {
        return examService.saveExam(user.username,jsonStr)
    }
}